﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class my_cmember_list : AdminpageBase
{
    protected List<Model.CMember> list = null;
    protected List<Model.MembershipGrade> meblist = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            inidata();
        }
    }
    private void inidata()
    {
        int cout = 0;
        meblist = BLL.MembershipGrade.GetPageList_Where(0,int.MaxValue, out cout);
        int totalcount = 0;
        list = BLL.CMember.Getall(this.AspNetPager1.CurrentPageIndex - 1, this.AspNetPager1.PageSize, out totalcount);
        PagedDataSource pds = new PagedDataSource();
        if (list != null && list.Count > 0)
        {

            AspNetPager1.Visible = true;
            AspNetPager1.RecordCount = totalcount;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;

        }
        else
        {
            AspNetPager1.Visible = false;

        }
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        inidata();
    }
    protected string getMemshipTitle(object id)
    {
       Model.MembershipGrade model= BLL.MembershipGrade.GetModel(int.Parse(id.ToString()));
       return model != null ? model.Title : "无数据";
    }
}